#include <stdio.h>
#include <conio.h>

int main(){
    int x = 100,y = 200;
    int *ptr = &x;
    printf("x的地址:%p,值:%d\n",&x,x);
    printf("y的地址:%p,值:%d\n",&y,y);
    printf("&ptr:%p,ptr:%p\n\n",&ptr,ptr);

     printf("x = %d, *ptr = %d\n\n",x,*ptr);

     ptr = &y;
     printf("执行ptr = &y\n");
     printf("&ptr:%p,ptr:%p\n\n",&ptr,ptr);
     printf("y = %d, *ptr = %d\n\n",y,*ptr);

     getch();
     return 0;
}